package com.forekonw.demotest1029;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Order order = new Order();
        order.books();
        OrderItem[] arr = new OrderItem[3];
        Scanner input = new Scanner(System.in);
        double[] al = new double[3];
        OrderItem orderltem = new OrderItem();
        double all = 0.0;
        int i = 0;
        for (i =0 ;i<3;i++){
            System.out.println("请输入图书编号:");
            int number = input.nextInt();//查金额和对应数组
            System.out.println("请输入购买数量：");
            int count = input.nextInt();//有用
            System.out.println("请继续购买图书！！！");
            all = order.allmoney(number,count);
            for (int j = i ; j<al.length;j++){
                al[j] = all;
                break;
            }
            orderltem = order.orderltems(number,count);
            for (int k = i;k<arr.length;k++){
                arr[k] = orderltem;
                break;
            }
        }
        double sum = 0.0;
        for ( i = 0 ; i <al.length;i++){
            sum+=al[i];
        }
        System.out.println("0001");
        System.out.println("订单的总额为:"+ sum);
        for (i=0;i<arr.length;i++){
            System.out.println(arr[i].getBname()+"--"+arr[i].getBmoney()+"--"+arr[i].getBno());
        }

    }
}
